package com.lysj.food.food.repository;

import com.lysj.admin.utils.spring.foundation.base.BaseRepository;
import com.lysj.admin.utils.web.SelectItem;
import com.lysj.food.food.domain.Food;
import com.lysj.food.food.domain.FoodAttribute;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author Created by wtl on 2019-03-19 16:00:45
 * @description 菜品属性dao
 */
public interface FoodAttributeRepository extends BaseRepository<FoodAttribute> {


    /**
     * 根据门店id和菜品属性类型获取菜品详情列表
     */
    @Query("select new com.lysj.admin.utils.web.SelectItem(d.id,d.name) from FoodAttribute f, FoodAttributeDetail d where f.id = d.foodAttributeId and d.storeId=?1 and f.type=?2 ")
    List<SelectItem> findStoreFoodAttribute(String storeId, Integer type);

}